<?php if(empty($all)):?>
<h1>No existen usuarios registrados</h1>
<?php else:?>
   
      <div class="centered">
         <div class="grid-1">
            <div class="title-grid"> <span>Usuarios</span></div>
            <!--            //************************************************************************************************************************************
            //buscador filtro-->
            <div class="search" style=" float: left; margin: 0 auto; padding: 10px; text-align: center; width: 100%;">
                <div class="search-title">Busqueda R&aacute;pida</div>
                
                <?php  echo $this->Form->create('Usuarios', array('action' => 'buscar'));?>
                
                <input  type="text" name="dato" class="input-search">
                <div>Estado: </div>
                <div>
                     <?php echo $this->Form->select(null, array('1'=>'Habilitado', '0'=>'Deshabilitado'), array('name'=>'estado'));?>
                </div>
                <div>Tipo: </div>
                <div>
                     <?php echo $this->Form->select(null, $tipos, array('name'=>'tipo'));?>
                </div>
               
                <?php  $options = array('Value'=>'Buscar','class' => 'search-submit');?>
                <?php echo $this->Form->end($options); ?>
            </div>
<!--            //************************************************************************************************************************************-->
            <div class="content-gird">
            <div id="imprime">
               <div class="logoprint">
                  
               </div>
                            
               <table class="display">
                  <thead>
                     <tr class="oculto">
                        <th colspan="7">Lista de Usuarios registrados</th>
                     </tr>
                     <tr>
                        
                        <th class="th_nombre">Nombres</th>
                        <th class="th_tipo">Tipo</th>
                        <th class="th_usuario">Usuario</th>
                        <th class="th_correo">Correo</th>
                        <th class="th_ci">C.I.</th>
                        <th class="th_action">Acciones</th>
                     </tr>
                  </thead>
                  <tbody>
                     <?php foreach($all as $usu):?>
                         <tr class="item">
                          
                            <td> <?php echo $usu['Usuario']['nombre'];?></td>
                            <td><?php echo $usu['Tipousuario']['tipo'];?></td>
                            <td><?php echo $usu['Usuario']['usuario'];?></td>
                            <td class="name"><?php echo $usu['Usuario']['correo'];?></td>
                            <td><?php echo $usu['Usuario']['ci'];?></td>
                            <td class="th_action">
                               <?php echo $this->Html->link($this->Html->image('/images/edit.png', array("alt"=>'Editar', 'title'=>'editar')), array('action'=>'editar', $usu['Usuario']['id']),array('escape' => false));?>&nbsp;
                               <?php //echo $this->Html->link($this->Html->image('/images/del.png',array("alt"=>'Borrar', 'title'=>'eliminar')), array('action'=>'eliminar',$usu['Usuario']['id']), array('escape' => false));?>&nbsp;
                            </td>
                         </tr>
                     <?php endforeach;?>
                  </tbody>
               </table><!--fin tabla-->
               </div>
           
               </div>
            </div><!--fin contenido grid-->
             <div class="grid-buttons">
             <!--<div class="title-grid"><span>Acciones</span></div>-->
             <div class="content-gird">
                <div class="button">
                   
                   <?php echo $this->Html->link('Registrar Usuario', '/usuarios/insertar', array('title'=>'Insertar nuevo')); ?>
                </div>
                 
                <div style="float:left;">
                   <?php echo $this->Form->button('Imprimir Lista', array('title'=>'Imprimir lista', 'id'=>'btnImprimir', 'class'=>'mybutton')); ?>
                </div>
            <div class="clear"> </div>
             </div>
            
         </div>
         </div><!--fin contenido-->
      </div><!--End div centered-->
<?php endif;?>
 <script type="text/javascript">
   jQuery(document).ready(function() {

         jQuery("#btnImprimir").click(function() {
            //printElem({ leaveOpen: true, printMode: 'popup' });
            printElem({ overrideElementCSS: ['http://www.atotic.com/viva/inventario/app/webroot/css/printable.css'] });
         });
     });
 function printElem(options){
     jQuery('#imprime').printElement(options);
 }
</script>